package com.arcrnone.test;

import android.app.Application;
import android.app.Activity;

import com.wacai.android.rn.bridge.ReactBridgeSDK;
import com.wacai.android.rn.bridge.ReactConfiguration;
import com.wacai.android.rn.bridge.ReactPackageManager;
import com.wacai.android.reduxpigeon.PigeonListening;
import com.wacai.android.reduxpigeon.PigeonManager;
import com.wacai.android.reduxpigeon.PigeonPromise;
import com.wacai.android.reduxpigeon.PigeonReactModule;


public class DebugApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        ReactConfiguration configuration = new ReactConfiguration();
        ReactPackageManager.register(PigeonReactModule.class);
        configuration.setDebug(true);
        ReactBridgeSDK.setReactConfiguration(configuration);
        ReactBridgeSDK.start(this);

        PigeonManager.getInstance().register("close-page", null, new PigeonListening() {
            @Override
            public void run(Activity activity, Object o, PigeonPromise promise) {
                activity.finish();
            }
        });


    }
}
